import { BaseService } from '@cool-midway/core';
import { Provide } from '@midwayjs/core';
import { InfoBannerEntity } from '../entity/banner';
import { Repository } from 'typeorm';
import { InjectEntityModel } from '@midwayjs/typeorm';

@Provide()
export class InfoService extends BaseService {
  @InjectEntityModel(InfoBannerEntity)
  infoBannerEntity: Repository<InfoBannerEntity>;

  async listByEnabled() {
    return await this.infoBannerEntity.find({ where: { status: 1 } });
  }
}
